package com.googlecode.jstructs.instr;

import java.util.Map;

import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.VarInsnNode;


public class VarInsnNode2 extends VarInsnNode {
	public int var;
	private Variable variable;

	public VarInsnNode2(VarInsnNode var, final Variable variable) {
		super(var.getOpcode(), -1);
		this.variable = variable;
	}

	public VarInsnNode2(int opcode, final Variable variable) {
		super(opcode, -1);
		this.variable = variable;
	}

	public void accept(final MethodVisitor mv) {
		mv.visitVarInsn(opcode, variable.var);
	}

	public int getVar() {
		return variable.var;
	}

	public AbstractInsnNode clone(final Map labels) {
		return new VarInsnNode2(opcode, variable);
	}
}
